﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace EfficientlyLazy.PhotoFramer.Repository
{
    public interface IRepository<T> where T : class
    {
        IQueryable<T> All();

        T FindByPrimaryKey(Guid id);

        void Refresh(T entity);

        void Delete(T entity);
        void DeleteAndFlush(T entity);

        void Save(T entity);
        void SaveAndFlush(T entity);

        void Save(IEnumerable<T> entities);
        void SaveAndFlush(IEnumerable<T> entities);

        void FlushSessionScope();
    }
}